<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>switch输出</title>
</head>
<body>
	<script type="text/javascript">
		var week=new Date().getDay(); 
		var weekstr=""
		//多条件的判断语句switch
		/*switch(week){
			case 0:document.write("今天是星期日");break;
			case 1:document.write("今天是星期一");break;
			case 2:document.write("今天是星期二");break;
			case 3:document.write("今天是星期三");break;
			case 4:document.write("今天是星期四");break;
			case 5:document.write("今天是星期五");break;
			default:document.write("今天是星期六");

		}*/

		switch(week){
			case 0: weekstr="日";break;
			case 1: weekstr="一";break;
			case 2: weekstr="二";break;
			case 3: weekstr="三";break;
			case 4: weekstr="四";break;
			case 5: weekstr="五";break;
			default: weekstr="六";
		}
		document.write("今天是星期"+weekstr);
	</script>

</body>
</html>